<script setup>
import child from '@/components/07_composition_api_watch_provide_inject_child.vue'
import {provide, readonly, ref} from "vue";

let count = ref(0)
provide('count',readonly(count) )

let changeCount = () =>{
  count.value = 1
}
//1：提供方法修改count，但不建议修改，建议加readonly
provide('changeCount' , changeCount)

// setTimeout(()=>{
//   count.value +=1 ;
// },2000)
</script>

<template>
  <div>
    07_composition_api_watch_provide_inject.vue
    <child></child>
  </div>
</template>

<style scoped>

</style>